package com.ruoyi.youtian.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.youtian.mapper.FaultNotifyAnnounceMapper;
import com.ruoyi.youtian.domain.FaultNotifyAnnounce;
import com.ruoyi.youtian.service.IFaultNotifyAnnounceService;
import com.ruoyi.common.core.text.Convert;

/**
 * 报警消息通告Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-08
 */
@Service
public class FaultNotifyAnnounceServiceImpl implements IFaultNotifyAnnounceService 
{
    @Autowired
    private FaultNotifyAnnounceMapper faultNotifyAnnounceMapper;

    /**
     * 查询报警消息通告
     * 
     * @param id 报警消息通告主键
     * @return 报警消息通告
     */
    @Override
    public FaultNotifyAnnounce selectFaultNotifyAnnounceById(Long id)
    {
        return faultNotifyAnnounceMapper.selectFaultNotifyAnnounceById(id);
    }

    /**
     * 查询报警消息通告列表
     * 
     * @param faultNotifyAnnounce 报警消息通告
     * @return 报警消息通告
     */
    @Override
    public List<FaultNotifyAnnounce> selectFaultNotifyAnnounceList(FaultNotifyAnnounce faultNotifyAnnounce)
    {
        return faultNotifyAnnounceMapper.selectFaultNotifyAnnounceList(faultNotifyAnnounce);
    }

    /**
     * 新增报警消息通告
     * 
     * @param faultNotifyAnnounce 报警消息通告
     * @return 结果
     */
    @Override
    public int insertFaultNotifyAnnounce(FaultNotifyAnnounce faultNotifyAnnounce)
    {
        faultNotifyAnnounce.setCreateTime(DateUtils.getNowDate());
        return faultNotifyAnnounceMapper.insertFaultNotifyAnnounce(faultNotifyAnnounce);
    }

    /**
     * 修改报警消息通告
     * 
     * @param faultNotifyAnnounce 报警消息通告
     * @return 结果
     */
    @Override
    public int updateFaultNotifyAnnounce(FaultNotifyAnnounce faultNotifyAnnounce)
    {
        return faultNotifyAnnounceMapper.updateFaultNotifyAnnounce(faultNotifyAnnounce);
    }

    /**
     * 批量删除报警消息通告
     * 
     * @param ids 需要删除的报警消息通告主键
     * @return 结果
     */
    @Override
    public int deleteFaultNotifyAnnounceByIds(String ids)
    {
        return faultNotifyAnnounceMapper.deleteFaultNotifyAnnounceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除报警消息通告信息
     * 
     * @param id 报警消息通告主键
     * @return 结果
     */
    @Override
    public int deleteFaultNotifyAnnounceById(Long id)
    {
        return faultNotifyAnnounceMapper.deleteFaultNotifyAnnounceById(id);
    }
}
